//
//  CommodityInfoHeadView.m
//  DA_V
//
//  Created by 中亿世联前台 on 15/4/21.
//  Copyright (c) 2015年 zhouhai. All rights reserved.
//

#import "CommodityInfoHeadView.h"
#import "InterFace.h"

@implementation CommodityInfoHeadView


- (instancetype) initWithFrame:(CGRect)frame mage:(UIImage *)image{
    self = [super initWithFrame:frame];
    if (self) {
        UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-160)/2, 10, 160, self.frame.size.height - 10)];
        imageview.image = image;
        imageview.userInteractionEnabled = YES;
        [self addSubview:imageview];
        
        //在imageview上添加点击手势
        UITapGestureRecognizer *singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTap:)];
        [singleTapGestureRecognizer setNumberOfTapsRequired:1];
        [imageview addGestureRecognizer:singleTapGestureRecognizer];
    }
    return self;
}

+ (instancetype) commodityInfoHeadViewWithFrame:(CGRect)frame image:(UIImage *)image{
    
    CommodityInfoHeadView *view = [[CommodityInfoHeadView alloc] initWithFrame:frame mage:image];
    return view;
}

#pragma -mark 图片手势事件

- (void)singleTap:(UIGestureRecognizer*)gestureRecognizer
{

    [self.commDelegate getBut:@"zhouhai"];
}


@end
